﻿using Microsoft.EntityFrameworkCore;
using SlaughterItem.Common.Domains;
using SlaughterItem.Common.Domains.ListWeek2;
using SlaughterItem.Common.Domains.Check_Ins;
using SlaughterItem.Common.Domains.Manages;
using SlaughterItem.Common.Domains.Manages.Addr;
using SlaughterItem.Common.Domains.Quarantine;
using SlaughterItem.Common.Domains.RBAC;
using SlaughterItem.Common.Domains.SetUpScale;
using SlaughterItem.Common.Domains.Setup;
using SlaughterItem.Common.Domains.UPCTable;
using SlaughterItem.Common.Domains.Warehouse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SlaughterItem.Common.Domains.Saleser;
using SlaughterItem.Common.Domains.Detection;
using SlaughterItem.Common.Domains.PORk;
using SlaughterItem.Common.Domains.RKWeigh;
using SlaughterItem.Common.Domains.Log;

namespace SlaughterItem.Common.DBContext
{
    /// <summary>
    ///写入的  db上下文
    /// </summary>
    public class EFDBContext : DbContext
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="options"></param>
        public EFDBContext(DbContextOptions<EFDBContext> options) : base(options)
        {
        }

        #region RBAC权限管理
        /// <summary>
        /// 用户表
        /// </summary>
        public DbSet<Users> Users { get; set; }

        /// <summary>
        /// 角色表
        /// </summary>
        public DbSet<Roles> Roles { get; set; }

        /// <summary>
        /// 权限表
        /// </summary>
        public DbSet<Permissions> Permissions { get; set; }

        /// <summary>
        /// 人员表
        /// </summary>
        public DbSet<Staff> Staff { get; set; }
        #endregion

        #region 管理
        /// <summary>
        /// 省
        /// </summary>
        public DbSet<Provibces> Provibces { get; set; }

        /// <summary>
        /// 市
        /// </summary>
        public DbSet<Citys> Citys { get; set; }

        /// <summary>
        /// 区
        /// </summary>
        public DbSet<Areas> Areas { get; set; }

        /// <summary>
        /// 行业标签表
        /// </summary>
        public DbSet<Industrytags> Industrytags { get; set; }

        /// <summary>
        /// 行业标签表
        /// </summary>
        public DbSet<Business> Business { get; set; }

        /// <summary>
        /// 行业标签表
        /// </summary>
        public DbSet<Sections> Sections { get; set; }

        /// <summary>
        /// 行业标签表
        /// </summary>
        public DbSet<Clients> Clients { get; set; }
        #endregion

        #region 商品代号模块
        /// <summary>
        /// 商品分类表
        /// </summary>
        public DbSet<UPCTypeData> uPCTypeDatas { get; set; }
        /// <summary>
        /// 商品等级表
        /// </summary>
        public DbSet<GoodsGrade> goodsGrades { get; set; }
        /// <summary>
        /// 商品代号表
        /// </summary>
        public DbSet<UPCData> uPCDatas { get; set; }
        #endregion 

        #region 进场检验
        /// <summary>
        /// 此表为无用表
        /// </summary>
        public DbSet<QuarantineData> quarantineDatas { get; set; }
        /// <summary>
        /// 检测项目表
        /// </summary>
        public DbSet<PRQSData> pRQSDatas { get; set; }
        /// <summary>
        /// 检测标准表
        /// </summary>
        public DbSet<IPQCData> iPQCDatas { get; set; }
        /// <summary>
        /// 检测类型标准备注表
        /// </summary>
        public DbSet<IPQCRemarkData> iPQCRemarkDatas { get; set; }
        /// <summary>
        /// 检疫标准应用商品缓存表
        /// </summary>
        public DbSet<IPQCGoodsData> iPQCGoodsDatas { get; set; }
        /// <summary>
        /// 检疫报告表
        /// </summary>
        public DbSet<COAData> COAData { get; set; }
        /// <summary>
        /// 检疫报告检疫商品缓存表
        /// </summary>
        public DbSet<COAPRQSData> cOAPRQSDatas { get; set; }
        /// <summary>
        /// 检疫报告结果表
        /// </summary>
        public DbSet<COAStandardData> COAStandardData { get; set; }
        /// <summary>
        /// 进场生猪检疫表
        /// </summary>
        public DbSet<QuarantinePigData> quarantinePigDatas { get; set; }
        /// <summary>
        /// 进场生猪检疫项目表
        /// </summary>
        public DbSet<QuarantinePigTypeData> quarantinePigTypeDatas { get; set; }
        #endregion

        #region 磅秤设置
        public DbSet<scaleContexts>  scaleContexts { get; set; }

        //猪
        public DbSet<Pigs> Pigs { get; set; }

        //进场编号猪关联
        public DbSet<CheckInPigs> CheckInPigs { get; set; }
        #endregion

        #region 或畜管理
        //待宰管理
        public DbSet<Slaughteredtes> Slaughteredtes {  get; set; }
        //活畜称重单
        public DbSet<LiveAnimals> LiveAnimals {  get; set; }





        #endregion

        #region 基础设置
        //商品批号
        public DbSet<Product> Product { get; set; }
        //生产班组
        public DbSet<Production> Production { get; set; }
        //磅秤类型
        public DbSet<ScaleType> ScaleType { get; set; }
        #endregion

        #region 批宰管理
        //制单人
        public DbSet<Make> Make { get; set; }
        //批宰计划
        public DbSet<Slaughter> Slaughter { get; set; }
        //分割领用
        public DbSet<SplitRequis> SplitRequis { get; set; }
        //皮重设置
        public DbSet<Tare> Tare { get; set; }
        #endregion

        #region 进场登记
        /// <summary>
        /// 进场登记
        /// </summary>
        public DbSet<CheckIn> CheckIn { get; set; }
        /// <summary>
        /// 供应商
        /// </summary>
        public DbSet<Supplier> Supplier { get; set; }
        /// <summary>
        /// 结算类型
        /// </summary>
        public DbSet<SettlementType> SettlementType { get; set; }
        /// <summary>
        /// 进场状态
        /// </summary>
        public DbSet<CheckInState> CheckInState { get; set; }
        #endregion

        #region 仓库模块
        /// <summary>
        /// 仓库表
        /// </summary>
        public DbSet<WarehouseData> warehouseDatas { get; set; }
        /// <summary>
        /// 仓库类型表
        /// </summary>
        public DbSet<DepotType> depotTypes { get; set; }
        /// <summary>
        /// 入库类型表
        /// </summary>
        public DbSet<StoreType> storeTypes { get; set; }
        #endregion

        #region 基础设置
        /// <summary>
        /// 待宰圈设置
        /// </summary>
        public DbSet<Waitings> Waitings { get; set; }
        /// <summary>
        /// 折扣项设置
        /// </summary>
        public DbSet<Deductions> Deductions { get; set; }
        #endregion

        #region 批宰管理
        /// <summary>
        /// 副产称重
        /// </summary>
        public DbSet<WeighingSheets> WeighingSheets { get; set; }
        #endregion

        #region 称重
        public DbSet<Sale> Sale { get; set; }
        public DbSet<Oilyfat> Oilyfat { get; set; }
        #endregion

        #region 明细
        public DbSet<SalesDetails> SalesDetails { get; set; }
        public DbSet<Scratches> Scratches { get; set; }
        public DbSet<SalesSummary> SalesSummary { get; set; }
        #endregion

        #region 白条
        /// <summary>
        /// 白条称重明细表
        /// </summary>
        public DbSet<WhiteporkData> whiteporkDatas { get; set; }
        #endregion

        #region 日志管理
        public DbSet<LogData> logData { get; set; }
        #endregion

        #region 分割入库称重
        public DbSet<RKWeighData> RKWeighData { get; set; }
        #endregion
    }
}
